<?php

namespace App\Models;

use Carbon\Carbon;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;

class
BaseModel extends Model {
	use HasFactory, Notifiable;

	protected function serializeDate( DateTimeInterface $date ) {
		return Carbon::instance( $date )->toDateTimeString();//这里使用toDateTimeString，不受Carbon中时区的影响
	}
}
